import { numTwoDecimal, numPositiveLimit } from '@/utils/formRules';

const instruanceInfoFiledList = [
	{
		type: 'text',
		label: '保险名称',
		isRequired: true,
		labelWidth: '100px',
		bindFieldName: 'insuranceName',
		bindFieldVal: '',
	},
	{
		type: 'text',
		label: '保险编号',
		isRequired: true,
		bindFieldName: 'insuranceCode',
		bindFieldVal: '',
	},
	{
		type: 'select',
		label: '保险类型',
		isRequired: true,
		optionList: [],
		keyName: 'dictValue',
		valName: 'dictLabel',
		bindFieldName: 'insuranceType',
		bindFieldVal: '',
	},
	{
		type: 'text',
		label: '保险公司',
		isRequired: true,
		bindFieldName: 'insuranceCorporation',
		bindFieldVal: '',
	},
	{
		type: 'text',
		label: '保险金额',
		isRequired: true,
		bindFieldName: 'insuranceAmount',
		bindFieldVal: '',
		maxlength:18,
		rules: [{ validator: numTwoDecimal(), trigger: ['change', 'blur'] }],
	},
	{
		type: 'file',
		label: '保险附件',
		isRequired: true,
		limit: 10,
		baseUrl: process.env.VUE_APP_BASE_API_ZK,
		fileSize: 1000,
		acceptType: '*',
		multiple: false,
		isDisabled: false,
		bindFieldName: 'attachmentUrlList',
		bindFieldVal: [],
	},
	{
		type: 'text',
		inputType: 'textarea',
		label: '说明',
		bindFieldName: 'remark',
		bindFieldVal: '',
		maxlength:140
	},
];

const instruanceSettingFiledList = [
	{
		type: 'date',
		label: '开始时间',
		isRequired: true,
		labelWidth: '100px',
		bindFieldName: 'insuranceStartTime',
		bindFieldVal: '',
	},
	{
		type: 'date',
		label: '结束时间',
		isRequired: true,
		bindFieldName: 'insuranceEndTime',
		bindFieldVal: '',
		rules: [],
	},
	{
		type: 'text',
		label: '保险期限',
		isDisabled: true,
		bindFieldName: 'baoxianqixian',
		bindFieldVal: '',
	},
	{
		type: 'text',
		label: '剩余天数',
		isDisabled: true,
		bindFieldName: 'shengyutianshu',
		bindFieldVal: '',
	},
	{
		type: 'radio',
		label: '需要提醒',
		isRequired: true,
		optionList: [{key:1, label:"是"},{key:0, label:"否"}],
		keyName: 'key',
		valName: 'label',
		bindFieldName: 'warnStatus',
		bindFieldVal: 0,
	},
	{
		type: 'text',
		label: '提醒时间',
		isRequired: true,
		bindFieldName: 'warnNum',
		bindFieldVal: '',
		unit: '天',
		reasonObj: {
			filedName: 'warnStatus',
			filedVal: [1],
		},
		rules: [
			{ validator: numPositiveLimit(), trigger: ['change', 'blur'] },
		],
	},
]

export { instruanceInfoFiledList, instruanceSettingFiledList };
